import router from '@system.router';
export default {
    data: {
        durationRange: ["1", "2", "3"],
        durationSelected: 1,
        rhythmRange: ["初级", "中级", "高级"],
        rhythmSelected: 1
    },
    onInit() {
        console.log("主页面的onInit()正在被调用");
    },
    onReady() {
        console.log("主页面的onReady()正在被调用");
    },
    onShow() {
        console.log("主页面的onShow()正在被调用");
    },
    onDestroy() {
        console.log("主页面的onDestroy()正在被调用");
    },
    // 改变时间
    onDurationChange(pv) {
        console.log("时长改变：" + pv.newSelected);

        this.durationSelected = pv.newSelected;
    },
    // 改变节奏
    onRhythmChange(pv) {
        console.log("节奏改变：" + pv.newSelected);

        this.rhythmSelected = pv.newSelected;
    },
    // 点击开始
    onClick() {
        router.push ({
            uri: 'pages/countdown/countdown',
            // 路由传参
            params: {
                "durationSelected": this.durationSelected,
                "rhythmSelected": this.rhythmSelected
            }
        })
    },
}
